package com.orcamento.entity.report.subreport;

import com.orcamento.util.Money;

public class CategoryBalance implements Comparable<CategoryBalance> {

	private String name;
	private Money total;

	public CategoryBalance(String name, Money totalGain) {
		this.name = name;
		this.total = totalGain;
	}
	
	@Override
	public int compareTo(CategoryBalance other) {
		if(other == null) {
			return 1;
		}
		if(total.equals(other.total)) {
			return 0;
		}
		return total.greaterThan(other.total) ? 1 : -1 ;

	}
	
	public String getName() {
		return name;
	}
	
	public Money getTotal() {
		return total;
	}
	
}
